package com.example.springstudy.controller;

import com.example.springstudy.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther ZhaoJunZhou
 * @Date 2020/9/23
 */
@RestController
@RequestMapping("aop")
public class AopTestControlller {
    @Autowired
    private OrderService orderService;
    @GetMapping("get")
    public String test() {
        System.out.println("action");
        return "aop test get success";

    }
    @RequestMapping("order/{id}")
    public String cacheTest(@PathVariable("id") Integer id) {
        return orderService.findOrder(id);
    }
}
